//
//  AddressCell.swift
//  WangPu
//
//  Created by xiaozhi on 15/10/22.
//  Copyright © 2015年 zhixiao. All rights reserved.
//

import UIKit

class AddressCell: UITableViewCell {
    @IBOutlet var name:UILabel!
    @IBOutlet var phone:UILabel!
    @IBOutlet var address:UILabel!
    @IBOutlet var line:UIView!
    @IBOutlet var lineHightConstraint:NSLayoutConstraint!
    @IBOutlet var setDefaultBtn:ImageHeadButton!
    @IBOutlet var editBtn:ImageHeadButton!
    @IBOutlet var deleteBtn:ImageHeadButton!
    var itemSelected:Bool=false
    var indexPath:NSIndexPath?
    var selectValueChangedEnclose:((NSIndexPath)->Void)?
    var editButtonClickHandle:((NSIndexPath)->Void)?
    var deleteButtonClickHandle:((NSIndexPath)->Void)?
    override func awakeFromNib() {
        super.awakeFromNib()
        self.selectionStyle = UITableViewCellSelectionStyle.None
        editBtn.imageSize = CGSizeMake(13, 13)
        editBtn.setImage(UIImage(named: "edit_icon1"), forState: UIControlState.Normal)
//        editBtn.setImage(UIImage(named: "downr_order_radio"), forState: UIControlState.Selected)
        deleteBtn.imageSize = CGSizeMake(13, 13)
        deleteBtn.setImage(UIImage(named: "delete_icon2"), forState: UIControlState.Normal)
        setDefaultBtn.imageSize = CGSizeMake(13, 13)
        setDefaultBtn.setImage(UIImage(named: "nor_checkbox"), forState: UIControlState.Normal)
        setDefaultBtn.setImage(UIImage(named: "down_checkbox"), forState: UIControlState.Selected)
        line.backgroundColor = commonBackgoundColor
        print(lineHightConstraint.constant)
        lineHightConstraint.constant = onePix
        // Initialization code
    }
    @IBAction func selectBtnClick(sender:UIButton)->Void{
        selectValueChangedEnclose?(indexPath!)
    }
    @IBAction func deleteButtonClick(button:UIButton)->Void{
        deleteButtonClickHandle?(indexPath!)
    }
    @IBAction func editButtonClick(button:UIButton)->Void{
        editButtonClickHandle?(indexPath!)
    }
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
